Lagrange multiplier with two constraints